package com.uzai.console.service.feign;

import com.uzai.console.common.UzaiRespVo;
import com.uzai.console.dto.feign.redpacket.*;
import com.uzai.console.service.feign.impl.RedPacketFeignFallbackFactory;
import com.uzai.console.vo.takebal.redpacket.feign.RedPacketCardVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Auther: jianghan
 * @Date: 2021/11/24 16:22
 * @Description:
 */
@Component
@FeignClient(value = "uzai-user-server", fallbackFactory = RedPacketFeignFallbackFactory.class)
public interface RedPacketFeignService {

    /**
     * 手动创建并发送红包卡片
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param redPacketCreateAndSendDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/create/send/redpacket")
    UzaiRespVo<Boolean> createAndSendRedpacket(@RequestBody RedPacketCreateAndSendDto redPacketCreateAndSendDto);

    /**
     * 手动创建并发送微信红包
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param wxredPacketCreateAndSendDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/create/send/wxredpacket")
    UzaiRespVo<Boolean> createAndSendWxredpacket(@RequestBody WxredPacketCreateAndSendDto wxredPacketCreateAndSendDto);

    /**
     * 根据存在的红包id重新发送红包
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param redPacketSendByIdDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/send/redpacket/byid")
    UzaiRespVo<Boolean> sendRedpacketById(@RequestBody RedPacketSendByIdDto redPacketSendByIdDto);


    /**
     * 根据存在的红包id获取已经存在的红包卡片
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param redPacketGetCardByIdDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/get/redpacket/card")
    UzaiRespVo<RedPacketCardVo> getRedpacketCardById(@RequestBody RedPacketGetCardByIdDto redPacketGetCardByIdDto);

    /**
     * 查询红包领取结果
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param redPacketQueryResultDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/take/redpacket/result/query")
    UzaiRespVo<Boolean> queryResult(@RequestBody RedPacketQueryResultDto redPacketQueryResultDto);

}
